.pure-code-input {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    line-height: 1;
    font-size: var(--pure-code-input-font-size);
    font-weight: var(--pure-code-input-font-weight);
    color: var(--pure-code-input-color);
    position: relative;
    padding: var(--pure-code-input-padding, 0);
    margin: var(--pure-code-input-margin, 0 auto);
    width: var(--pure-code-input-width, 100%);
    height: var(--pure-code-input-height);
    box-sizing: border-box;
}

.pure-code-input-box {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: var(--pure-code-input-box-width, 2.5em);
    height: var(--pure-code-input-box-height, 2.5em);
    border-style: var(--pure-code-input-box-border-style, solid);
    border-color: var(--pure-code-input-box-border-color, var(--pure-border-color-default));
    border-top-width: var(--pure-code-input-box-border-top-width, 1px);
    border-bottom-width: var(--pure-code-input-box-border-bottom-width, 1px);
    border-left-width: var(--pure-code-input-box-border-left-width, 1px);
    border-right-width: var(--pure-code-input-box-border-right-width, 1px);
    border-radius: var(--pure-code-input-box-border-radius, 0.25em);
    background-color: var(--pure-code-input-box-background-color, var(--pure-code-input-color));
    position: relative;
    transition: var(--pure-code-input-box-transition, all 0.2s ease-in-out);
    background: var(--pure-code-input-box-background, var(--pure-background-element));
    box-shadow: var(--pure-code-input-box-box-shadow, 0 0 1em rgba(0, 0, 0, 0.1));
    overflow: hidden;
}

.pure-code-input-box::before {
    content: '';
    width: var(--pure-code-input-cursor-width, 2px);
    height: var(--pure-code-input-cursor-height, 40%);
    background: var(--pure-code-input-cursor-color, var(--pure-theme-primary));
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: var(--pure-code-input-cursor-border-radius, 2px);
    opacity: 0;
}

.pure-code-input:focus-within .pure-code-input-box-focus {
    border-color: var(--pure-code-input-box-waiting-border-color, var(--pure-theme-primary));
    border-top-width: var(--pure-code-input-box-waiting-border-top-width, 1px);
    border-bottom-width: var(--pure-code-input-box-waiting-border-bottom-width, 1px);
    border-left-width: var(--pure-code-input-box-waiting-border-left-width, 1px);
    border-right-width: var(--pure-code-input-box-waiting-border-right-width, 1px);
    background: var(--pure-code-input-box-waiting-background, var(--pure-background-element));
}

.pure-code-input:focus-within .pure-code-input-box-blink::before {
    animation: pure-code-input-cursor-blink 1s ease-in-out infinite forwards;
}

/* 快手小程序 focus 不生效 */
/* #ifdef MP-KUAISHOU */
.pure-code-input-box-focus {
    border-color: var(--pure-code-input-box-waiting-border-color, var(--pure-theme-primary));
    border-top-width: var(--pure-code-input-box-waiting-border-top-width, 1px);
    border-bottom-width: var(--pure-code-input-box-waiting-border-bottom-width, 1px);
    border-left-width: var(--pure-code-input-box-waiting-border-left-width, 1px);
    border-right-width: var(--pure-code-input-box-waiting-border-right-width, 1px);
    background: var(--pure-code-input-box-waiting-background, var(--pure-background-element));
}

.pure-code-input-box-blink::before {
    animation: pure-code-input-cursor-blink 1s ease-in-out infinite forwards;
}

/* #endif */

.pure-code-input-input {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    background-color: transparent;
    text-align: center;
    opacity: 0;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 8;
    display: block;
    color: rgba(0, 0, 0, 0);
}

/* 光标闪烁动画 */
@keyframes pure-code-input-cursor-blink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}
